package generator

import (
	"kumachan/standalone/util/richtext"
)

type E_UnusedBinding struct {
	Name  string
}
func (e E_UnusedBinding) DescribeError() richtext.Block {
	var b richtext.Block
	b.WriteSpan("unused binding:", richtext.TAG_ERR_NORMAL)
	b.WriteSpan(e.Name, richtext.TAG_ERR_INLINE)
	return b
}

type E_CircularThunkDependency struct {
	Names  [] string
}
func (e E_CircularThunkDependency) DescribeError() richtext.Block {
	var b richtext.Block
	b.WriteSpan(
		"dependency cycle(s) detected within thunk functions:",
		richtext.TAG_ERR_NORMAL,
	)
	for i, name := range e.Names {
		if i > 0 {
			b.WriteSpan(",")
		}
		b.WriteSpan(name, richtext.TAG_ERR_INLINE)
	}
	return b
}


